;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; vlog-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path (concat home-emacs-d "site-lisp/vlog-mode"))
(require 'vlog-mode)

(add-to-list 'auto-mode-alist '("\\.v\\'" . vlog-mode))
(add-to-list 'auto-mode-alist '("\\.vl\\'" . vlog-mode))

(vlog-mode-enable-v2k)

(setq vlog-mode-highlight-all-uppercase-words nil)
(setq vlog-align-do-align-for-assign nil)
(setq vlog-align-mod-inst-stop-list '(16 48))
(setq vlog-align-declaration-stop-list '(7 24 36 38 48))
(setq vlog-indent-level-beh                2
      vlog-indent-level-block              0
      vlog-indent-level-block-beh          0
      vlog-indent-level-block-inside       2
      vlog-indent-level-case-inside        4
      vlog-indent-level-case-branch-inside 2
      vlog-indent-level-cond               2
      vlog-indent-level-default            2
      vlog-indent-level-port-list          3)

(setq vlog-mode-keywordset-docs
      (append vlog-mode-keywordset-docs
              (list "Note:" "NOTE:" "note:")))
(vlog-mode-make-keywords)

(require 'compile)
(setq compilation-error-regexp-alist
      (append
       '(;; synopsys vcs 
         ("[ \n\t]*\"[ \n\t]*\\([^\"\n\t]+\\)[\n\t]*\",[ \n\t]*\\([0-9]+\\)" 1 2)
         ("Invalid instantiation at: \"[ \n\t]*\\([^\"\n\t]*\\)[\n\t]*\", \\([0-9]+\\):" 1 2)
         ("Parsing design file '[ \n\t]*\\([^'\n\t]*\\)[\n\t]*\'\\([0-9]*\\)" 1 2)
         )
       compilation-error-regexp-alist))
;;(setq compilation-error-regexp-alist
;;      (append
;;       '(;; synopsys vcs
;;         ("\\(Warning\\|Error\\|Lint\\|Invalid\\)[^\"]*\"[ \n\t]*\\([^\"\n\t]+\\)[\n\t]*\",[ \n\t]*\\([0-9]+\\)" 2 3)
;;         ("Warning-\\([\n]\\|.\\)*?[\t]*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3)
;;         ("Error-\\([\n]\\|.\\)*?[\t]*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3))
;;       compilation-error-regexp-alist))
;;         ("Parsing design file '[ \n\t]*\\([^'\n\t]*\\)[\n\t]*\'" 1 nil)
